package com.zhijiaoyun.common;

/**
 * @author shisfish
 * @date 2017/6/6
 */
public class HtmlModal {

	public static String REGISTER = "register";
	public static String PASSWORD = "password";
	
	private static final String REGISTER_HEAD = "<!DOCTYPE html>" + "<html>"
			+ "<head>"
			+ "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\">"
			+ "<meta charset=utf-8>" + "<title>注册页面</title>" + "</head>" + "<body><div id=\"app\"></div>" + "</body>" + "<script>";
			
	private static final String REGISTER_BOTTOM =  "</script><script type=\"text/javascript\" src=\"http://123.206.192.21:8080/zhijiaoyun-register-common/static/js/register.js\"></script>"
			+ "</html>";

	private static final String PASSWORD_HEAD = "<!DOCTYPE html>" + "<html>"
			+ "<head>"
			+ "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\">"
			+ "<meta charset=utf-8>" + "<title>忘记密码页面</title>" + "</head>" + "<body><div id=\"app\"></div>" + "</body>" + "<script>";
	
	private static final String PASSWORD_BOTTOM =  "</script><script type=\"text/javascript\" src=\"http://123.206.192.21:8080/zhijiaoyun-register-common/static/js/password.js\"></script>"
			+ "</html>";
	
	public static String getHtmlModal(String data, String type) {
		String body = "";
		switch (type) {
		case "register": {
			String html = "window._register = " + data + ";";
			body = REGISTER_HEAD + html + REGISTER_BOTTOM;
			break;
		}
		case "password": {
			String html = "window._password = " + data + ";";
			body = PASSWORD_HEAD + html + PASSWORD_BOTTOM;
			break;
		}
		default:
			break;
		}
		return body;
	}
}
